package com.stluke.oma;

import org.openqa.selenium.WebDriver;

import com.oma.testcase.*;


public class MedSecToUnit extends Webdriver {
	
	public static String refNum;
	public static WebDriver driver;
	
	public static void main(String[] args) throws Exception
	{	
    	Webdriver d = new Webdriver();
		driver = d.startUp();
		
		Login in = new Login();
		Logout out = new Logout();
		Search_Applicant ms = new Search_Applicant();
		Decision dc = new Decision();
		Email letter = new Email();
		Select_Applicant sa = new Select_Applicant();
		Upload up = new Upload();
		MedSec meds = new MedSec();
		DoctorCode code = new DoctorCode();
		Privilege priv = new Privilege();
		
		//RECEIVER
			
			in.login(driver, "reviewer");
			refNum = sa.review(driver);
			up.upload(driver);
			out.logout(driver);
	
		//MEDICAL SECRETARY to DEPARTMENT

			in.login(driver, "secretary");
			ms.search(driver, refNum);
			dc.decision(driver, "approve", "Medical Secretary");
			meds.select(driver, "unit");
			out.logout(driver);
		
		//UNIT HEAD
			
			in.login(driver, "unit");
			ms.search(driver, refNum);
			priv.privilege(driver);
			dc.decision(driver, "defer", "Unit Head");
			out.logout(driver);
		

		//MEDICAL SECRETARY to DIRECTOR
			
			in.login(driver, "secretary");
			ms.search(driver, refNum);
			dc.decision(driver, "approve", "Medical Secretary");
			out.logout(driver);
			
		//DIRECTOR : Approve
			
			in.login(driver, "director");
			ms.search(driver, refNum);
			dc.decision(driver, "approve", "Director");
			out.logout(driver);
			
		//PRESIDENT : Approve
			
			in.login(driver, "president");
			ms.search(driver, refNum);
			dc.decision(driver, "approve", "President");
			out.logout(driver);

		//REVIEWER EMAIL : Approved & Assign Doctor Code
			
			in.login(driver, "reviewer");
			ms.search(driver, refNum);
			letter.mail(driver, "approve");
			code.code(driver, "3214");
			out.logout(driver);
			
			
    }
	

}
